<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{:session('cp.cpsysname')}--系统管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/assets/common/css/index.css"/>
    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

{include file='public/header'/}
<!------------------导航-------------------------->
<section>
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading">
            <h3>
                一什智慧城后台管理系统
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">用户管理</a>
                </li>
                <li class="active" style="color: #02b87f;"> 修改用户</li>
            </ul>
        </div>
        <div class="panel mgr15 mgl15">
            <div class="panel-heading addCharts" style="background:#ededed;">
                修改用户
            </div>
            <div class="panel-body">
                <form class="form-horizontal adminex-form" action='' method="post" id="sysuser" enctype="multipart/form-data">
                    <div class="form-group" id="ferror1" >
                        <label class="col-sm-2 col-sm-2 control-label">姓名</label>
                        <div class="col-sm-10">
                            <input type="hidden" value="{$user.id}" name="id">
                            <input type="text" class="form-control" id='username' name='username' value="{$user.username}">
                            <div id="error1" class="error"></div>
                        </div>
                    </div>
                    <div class="form-group" id="ferror3" >
                        <label class="col-sm-2 col-sm-2 control-label">手机号</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id='tel' name='tel' value="{$user.tel}">
                            <div id="error3" class="error"></div>
                        </div>
                    </div>
                    <div class="form-group" id="ferror2">
                        <label class="col-sm-2 col-sm-2 control-label">密码</label>
                        <div class="col-sm-10">
                            <input type="password" id='password' name='password' class="form-control">
                            <div id="error2" class="error"></div>
                        </div>
                    </div>



                    <div style="text-align: center">

                        <button type="button" onclick="addform()" class="btn btn-primary">修改用户</button>
                    </div>
                </form>
            </div>
        </div>
        <include file='Index/footer'/>

    </div>
</section>
<script>
    function addform() {
        $('#ferror1').removeClass('has-error');
        $('#ferror3').removeClass('has-error');
        $('#error1').text('');
        $('#error2').text('');
        var username = $('#username').val();
        var password = $('#password').val();
        var qx = $('#qx').val();
        if (username === '') {
            $('#ferror1').addClass('has-error');
            $('#error1').text('用户名不能为空');
            $('#username').focus();
            return;

        }

        if (qx === '') {
            $('#ferror3').addClass('has-error');
            $('#error3').text('请设定用户类型');
            $('#password').focus();
            return;

        }
        $('#sysuser').submit();

    }
    function showqx(va) {

        switch (va.value) {
            case '0' :
                $('#levelst').hide();
                $('#machlist').hide();
                break;
            case '1':
                $('#levelst').show();
                $('#machlist').hide();
                break;
            case '2' :
                $('#machlist').hide()
                $('#levelst').hide();
                break;
            case '3' :
                $('#machlist').show();
                $('#levelst').hide();
                break;
            case '4':
                $('#machlist').show();
                $('#levelst').hide();
                break;
            default:
                alert(555);
        }


    }
</script>
</body>
</html>
